package mn.joker.androidgames;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

public class LifeCycleTest extends Activity{
	StringBuilder strBuilder = new StringBuilder();
	TextView textView;
	
	private void log(String text)
	{
		Log.d("LifeCycleTest", text);
		strBuilder.append(text);
		strBuilder.append('\n');
		textView.setText(strBuilder.toString());
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		
		textView = new TextView(this);
		textView.setText(strBuilder.toString());
		setContentView(textView);
		log("Created");
	}

	@Override
	protected void onPause() {
		// TODO Auto-generated method stub
		super.onPause();
		log("Paused");
		
		if(isFinishing())
			log("Finishing");
	}

	@Override
	protected void onResume() {
		super.onResume();
		log("Resumed");
	}

	
}
